package basicShapes;

import java.awt.Graphics2D;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import image.Image;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "pointsX",
    "pointsY",
    "size"
})
@XmlRootElement
public class Polygon extends Image {

	@XmlAttribute
	protected int pointsX[];
	@XmlAttribute
	protected int pointsY[];
	@XmlAttribute
	protected int size; 
	
	public Polygon() {
		
	}
	
	public Polygon(int pointsX[], int pointsY[] ,int size) {
		this.pointsX = pointsX;
		this.pointsY = pointsY;
		this.size=size;
	}
	
	public void draw( Graphics2D g){
		g.draw(new java.awt.Polygon(pointsX, pointsY, size));
	}
	public String toString(){
		return "Polygon - x:"+this.pointsX[0]+" y:"+this.pointsY[0];
	}
}
